.\"     Title: \fBndb_config\fR
.\"    Author: 
.\" Generator: DocBook XSL Stylesheets v1.70.1 <http://docbook.sf.net/>
.\"      Date: 03/31/2009
.\"    Manual: MySQL Database System
.\"    Source: MySQL 5.1
.\"
.TH "\fBNDB_CONFIG\fR" "1" "03/31/2009" "MySQL 5.1" "MySQL Database System"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
ndb_config \- extract MySQL Cluster configuration information
.SH "SYNOPSIS"
.HP 19
\fBndb_config \fR\fB\fIoptions\fR\fR
.SH "DESCRIPTION"
.PP
This tool extracts configuration information for data nodes, SQL nodes, and API nodes from a cluster management node (and possibly its
\fIconfig.ini\fR
file).
.PP
\fBUsage\fR:
.sp
.RS 3n
.nf
ndb_config \fIoptions\fR
.fi
.RE
.PP
The
\fIoptions\fR
available for this utility differ somewhat from those used with the other utilities, and so are listed in their entirety in the next section, followed by some examples.
.PP
\fBOptions\fR:
.TP 3n
\(bu
\fB\-\-usage\fR,
\fB\-\-help\fR, or
\fB\-?\fR
.sp
Causes
\fBndb_config\fR
to print a list of available options, and then exit.
.TP 3n
\(bu
\fB\-\-version\fR,
\fB\-V\fR
.sp
Causes
\fBndb_config\fR
to print a version information string, and then exit.
.TP 3n
\(bu
\fB\-\-ndb\-connectstring=\fR\fB\fIconnect_string\fR\fR
.sp
Specifies the connectstring to use in connecting to the management server. The format for the connectstring is the same as described in
Section\ 17.3.4.3, \(lqThe MySQL Cluster Connectstring\(rq, and defaults to
localhost:1186.
.sp
The use of
\fB\-c\fR
as a short version for this option is supported for
\fBndb_config\fR
beginning with MySQL 5.1.12.
.TP 3n
\(bu
\fB\-\-config\-file=\fR\fB\fIpath\-to\-file\fR\fR
.sp
Gives the path to the management server's configuration file (\fIconfig.ini\fR). This may be a relative or absolute path. If the management node resides on a different host from the one on which
\fBndb_config\fR
is invoked, then an absolute path must be used.
.TP 3n
\(bu
\fB\-\-query=\fR\fB\fIquery\-options\fR\fR,
\fB\-q\fR
\fIquery\-options\fR
.sp
This is a comma\-delimited list of
query options
\(em that is, a list of one or more node attributes to be returned. These include
id
(node ID), type (node type \(em that is,
ndbd,
mysqld, or
ndb_mgmd), and any configuration parameters whose values are to be obtained.
.sp
For example,
\fB\-\-query=id,type,indexmemory,datamemory\fR
would return the node ID, node type,
DataMemory, and
IndexMemory
for each node.
.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
\fBNote\fR
If a given parameter is not applicable to a certain type of node, than an empty string is returned for the corresponding value. See the examples later in this section for more information.
.TP 3n
\(bu
\fB\-\-host=\fR\fB\fIhostname\fR\fR
.sp
Specifies the host name of the node for which configuration information is to be obtained.
.TP 3n
\(bu
\fB\-\-id=\fR\fB\fInode_id\fR\fR,
\fB\-\-nodeid=\fR\fB\fInode_id\fR\fR
.sp
Used to specify the node ID of the node for which configuration information is to be obtained.
.TP 3n
\(bu
\fB\-\-nodes\fR
.sp
(Tells
\fBndb_config\fR
to print information from parameters defined in
[ndbd]
sections only. Currently, using this option has no affect, since these are the only values checked, but it may become possible in future to query parameters set in
[tcp]
and other sections of cluster configuration files.)
.TP 3n
\(bu
\fB\-\-type=\fR\fB\fInode_type\fR\fR
.sp
Filters results so that only configuration values applying to nodes of the specified
\fInode_type\fR
(ndbd,
mysqld, or
ndb_mgmd) are returned.
.TP 3n
\(bu
\fB\-\-fields=\fR\fB\fIdelimiter\fR\fR,
\fB\-f\fR
\fIdelimiter\fR
.sp
Specifies a
\fIdelimiter\fR
string used to separate the fields in the result. The default is
\(lq,\(rq
(the comma character).
.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
\fBNote\fR
If the
\fIdelimiter\fR
contains spaces or escapes (such as
\\n
for the linefeed character), then it must be quoted.
.TP 3n
\(bu
\fB\-\-rows=\fR\fB\fIseparator\fR\fR,
\fB\-r\fR
\fIseparator\fR
.sp
Specifies a
\fIseparator\fR
string used to separate the rows in the result. The default is a space character.
.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
\fBNote\fR
If the
\fIseparator\fR
contains spaces or escapes (such as
\\n
for the linefeed character), then it must be quoted.
.sp
.RE
.PP
\fBExamples\fR:
.TP 3n
1.
To obtain the node ID and type of each node in the cluster:
.sp
.RS 3n
.nf
shell> \fB./ndb_config \-\-query=id,type \-\-fields=':' \-\-rows='\\n'\fR
1:ndbd
2:ndbd
3:ndbd
4:ndbd
5:ndb_mgmd
6:mysqld
7:mysqld
8:mysqld
9:mysqld
.fi
.RE
In this example, we used the
\fB\-\-fields\fR
options to separate the ID and type of each node with a colon character (:), and the
\fB\-\-rows\fR
options to place the values for each node on a new line in the output.
.TP 3n
2.
To produce a connectstring that can be used by data, SQL, and API nodes to connect to the management server:
.sp
.RS 3n
.nf
shell> \fB./ndb_config \-\-config\-file=usr/local/mysql/cluster\-data/config.ini \-\-query=hostname,portnumber \-\-fields=: \-\-rows=, \-\-type=ndb_mgmd\fR
192.168.0.179:1186
.fi
.RE
.TP 3n
3.
This invocation of
\fBndb_config\fR
checks only data nodes (using the
\fB\-\-type\fR
option), and shows the values for each node's ID and host name, and its
DataMemory,
IndexMemory, and
DataDir
parameters:
.sp
.RS 3n
.nf
shell> \fB./ndb_config \-\-type=ndbd \-\-query=id,host,datamemory,indexmemory,datadir \-f ' : ' \-r '\\n'\fR
1 : 192.168.0.193 : 83886080 : 18874368 : /usr/local/mysql/cluster\-data
2 : 192.168.0.112 : 83886080 : 18874368 : /usr/local/mysql/cluster\-data
3 : 192.168.0.176 : 83886080 : 18874368 : /usr/local/mysql/cluster\-data
4 : 192.168.0.119 : 83886080 : 18874368 : /usr/local/mysql/cluster\-data
.fi
.RE
In this example, we used the short options
\fB\-f\fR
and
\fB\-r\fR
for setting the field delimiter and row separator, respectively.
.TP 3n
4.
To exclude results from any host except one in particular, use the
\fB\-\-host\fR
option:
.sp
.RS 3n
.nf
shell> \fB./ndb_config \-\-host=192.168.0.176 \-f : \-r '\\n' \-q id,type\fR
3:ndbd
5:ndb_mgmd
.fi
.RE
In this example, we also used the short form
\fB\-q\fR
to determine the attributes to be queried.
.sp
Similarly, you can limit results to a node with a specific ID using the
\fB\-\-id\fR
or
\fB\-\-nodeid\fR
option.
.SH "COPYRIGHT"
.PP
Copyright 2007\-2008 MySQL AB, 2009 Sun Microsystems, Inc.
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
.PP
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110\-1301 USA or see http://www.gnu.org/licenses/.
.SH "SEE ALSO"
For more information, please refer to the MySQL Reference Manual,
which may already be installed locally and which is also available
online at http://dev.mysql.com/doc/.
.SH AUTHOR
MySQL AB (http://www.mysql.com/).
